$(document).ready(function() {
    $('#descricao').focus();
    $('.BtnSalvar').prop('disabled','disabled');
    $('#formEdita').validate({
        rules: {
            "modeloOficios.descricao": {                
                required: true,
                minlength: 3
            }
        },
        messages:{
            "modeloOficios.descricao":{
                required: "Esse campo deve ser preenchido",
                minlength: "Esse Campo deve conter, no minimo, 3 caracteres"
            }
        }
    });
    
    $('#formEdita input').on('keyup blur', function () { // fires on every keyup & blur
        
        if ($('#formEdita').valid()) {                   // checks form for validity
            $('.BtnSalvar').prop('disabled',false);        // enables button
        } else {
            $('.BtnSalvar').prop('disabled','disabled');   // disables button
        }
    });
}
 );
